package com.jec.module.sysconfig.service.configor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Component;

import com.jec.module.sysconfig.dao.MeetingRepository;
import com.jec.module.sysconfig.entity.MeetingConfig;
import com.jec.module.sysconfig.service.convertor.Convertor;
import com.jec.module.sysconfig.service.convertor.MeetingConvertor;

@Component
public class MeetingConfigor extends BaseConfigor<MeetingConfig> {
	
	@Autowired
	private MeetingRepository meetingRepository;
	
	@Autowired 
	private MeetingConvertor meetingConvertor;	
	
	public MeetingConfigor() {
		logKey = "会议";
	}

	@Override
	protected JpaRepository<MeetingConfig, Integer> getRepository() {
		return meetingRepository;
	}
	
	
	@Override
	protected Convertor<MeetingConfig> getConvertor() {
		return meetingConvertor;
	}

	@Override
	public boolean hasConfigOnNetunit(int netunit) {
		return !meetingRepository.findAllByNetunit(netunit).isEmpty();
	}

}
